package com.jnshu.service;

import com.jnshu.pojo.Course;
import com.jnshu.tools.resultUtils.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@FeignClient(value = "learning", url = "http://localhost:20822")
public interface LearningService {
    //文章列表
    @GetMapping(value = "/course/list")
    ResultBean SelectList(@RequestParam(required = false) Integer classify, @RequestParam(required = false) Integer subject, @RequestParam(required = false) Integer grade, @RequestParam(required = false) String title,
                          @RequestParam(required = false) Integer status,
                          @RequestParam(name = "pageNum", required = false) Integer pageNum,
                          @RequestParam(name = "pageSize", required = false) Integer pageSize);


    //上下架
    @PutMapping(value = "/course/status")
    ResultBean aStatus(@RequestParam Long id,
                       @RequestParam Integer status);

    //删除课程
    @DeleteMapping(value = "/course")
    ResultBean deleteByPrimaryKey(@RequestParam Long id);

    //新增视频
    @PostMapping(value = "/video")
    ResultBean aInsertVideo(@RequestParam Integer classify, @RequestParam Integer subject, @RequestParam Integer grade, @RequestParam String title,
                            @RequestParam String teacherName, @RequestParam String job, @RequestParam String cover, @RequestParam String videoLink,
                            @RequestParam String introduction, @RequestParam Integer status);

    //更新视频
    @PutMapping(value = "/video")
    ResultBean aUpdateVideo(@RequestParam Long id, @RequestParam Integer classify, @RequestParam Integer subject, @RequestParam Integer grade, @RequestParam String title,
                            @RequestParam String teacherName, @RequestParam String job, @RequestParam String cover, @RequestParam String videoLink,
                            @RequestParam String introduction, @RequestParam Integer status);

    //视频详情
    @GetMapping("/video")
    ResultBean VideotList(@RequestParam Long id);


    //文章详情
    @GetMapping("/content")
    ResultBean ContentList(@RequestParam Long id);

    //新增文章
    @PostMapping(value = "/content")
    ResultBean aInsertContent(@RequestParam Integer classify, @RequestParam Integer subject, @RequestParam Integer grade, @RequestParam String title,
                              @RequestParam String teacherName, @RequestParam String job, @RequestParam String cover,
                              @RequestParam String introduction, @RequestParam Integer status);

    //更新文章
    @PutMapping(value = "/content")
    ResultBean aUpdateContent(@RequestParam Long id, @RequestParam Integer classify, @RequestParam Integer subject, @RequestParam Integer grade, @RequestParam String title,
                              @RequestParam String teacherName, @RequestParam String job, @RequestParam String cover,
                              @RequestParam String introduction, @RequestParam Integer status);

}
